Public Partial Class Events
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim newEvent As New KDESolutions.Providers.Events.DataTypes.EventItem(txtTitle.Text, txtDescription.Text, txtURL.Text, cdStart.SelectedDate, cdEnd.SelectedDate)
        KDESolutions.Providers.Events.EventService.AddEvent(newEvent, HttpContext.Current.User.Identity.Name)
    End Sub

    Protected Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        GridView2.DataSource = KDESolutions.Providers.Events.EventService.GetEvents(cdSelect.SelectedDates.Item(0).Date, cdSelect.SelectedDates.Item(cdSelect.SelectedDates.Count - 1))
        GridView2.DataBind()
    End Sub

    Private Sub ObjectDataSource1_Deleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles ObjectDataSource1.Deleting
        e.InputParameters("Username") = HttpContext.Current.User.Identity.Name
    End Sub

    Private Sub ObjectDataSource1_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles ObjectDataSource1.Updating
        e.InputParameters("Username") = HttpContext.Current.User.Identity.Name
    End Sub
End Class